#include "../include/httpLib.hpp"
using namespace std;

void testSplit()
{
    std::string str = "hello,world,,,str,";
    vector<string> v;
    Util::split(str, &v, ",");
    for (auto& e : v)
        cout << e << '-';
    cout << endl;
}

void testReadAndWrite()
{
    std::string file = Util::readFile("text.cc");
    cout << file << endl;
    Util::writeFile("ttt.txt", file);
}

void textEncode()
{
    std::string str = "c+ +";
    std::string enc = Util::encodeUrl(str, false);
    cout << enc << endl;
}

void textDecode()
{
    const std::string str = "C%2B+%2B";
    std::string dec = Util::decodeUrl(str, false);
    cout << dec << endl;
}

void textfileSystem()
{
    const string str = "dir";
    const string str1 = "text.cc";
    cout << Util::isDirectory(str) << endl;
    cout << Util::isRegular(str1) << endl;
}

int main()
{
    // textSplit();
    // testReadAndWrite();
    // textEncode();
    // textDecode();
    textfileSystem();
    return 0;
}